/////////////////////////////////////////////////////////
//                                                     //
// Copyright (c) 2016年 上证云平台. All rights reserved. //
//                                                     //
/////////////////////////////////////////////////////////


#import "IPOCalendarViewController.h"

#if __has_include("MIPOCalendarView.h")

#import "IPODetailViewController.h"
#import "MApi.h"
#import "MIPOCalendarView.h"

@interface IPOCalendarViewController ()<MIPOCalendarViewDelegate>
{
    MIPOCalendarView *stockView;
}
@end

@implementation IPOCalendarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    stockView = [[MIPOCalendarView alloc]init];
    stockView.delegate = self;
    [self.view addSubview:stockView];
    [stockView loadData];
}

- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    stockView.frame = self.view.bounds;
}


- (void)IPOCalendarView:(MIPOCalendarView *)calendarView didSelectStockWithCode:(NSString *)code andName:(NSString *)name {
    IPODetailViewController *vc = [IPODetailViewController new];
    vc.code = code;
    [self presentViewController:[[UINavigationController alloc] initWithRootViewController:vc]
                       animated:YES
                     completion:nil];
}
    

@end

#endif